<template>
    <div id="second">
        <header-img></header-img>
        <header-navbar></header-navbar>
        <second-navbar></second-navbar>
        <news-list :thenew="thenew"></news-list>
        <kao-shi :kaoshi="kaoshi"></kao-shi>
        <bei-kao :beikao="beikao"></bei-kao>
        <ke-list></ke-list>
        <navbar-footer></navbar-footer>
    </div>
</template>

<script>
    import HeaderImg from "@/components/second/HeaderImage";
    import HeaderNavbar from "@/components/second/HeaderNavbar";
    import NewsList from "@/components/second/NewsList";
    import KaoShi from "@/components/second/KaoShi";
    import BeiKao from "@/components/second/BeiKao";
    import KeList from "@/components/second/KeList";
    import SecondNavbar from "@/components/second/SecondNavbar";
    import NavbarFooter from "@/components/index/NavbarFooter";
    export default {
        components: {
            HeaderImg ,
            HeaderNavbar,
            NewsList,
            KaoShi,
            BeiKao,
            KeList,
            NavbarFooter,
            SecondNavbar
        },
        data() {
            return {
                art: [],
                kaoshi: {},
                beikao: {},
                thenew: {}
            }
        },
        computed: {
            path() {
                return this.$route.path 
            }
        },
        watch: {
            path() {
                this.getArtical()
            }
        },
        created () {
            this.getArtical(  );
        },
        methods: {
            // 获取热门资讯
            async getArtical(  ) {
                let aid = this.$route.params.xueliid
                this.hotArt = []
                this.companyArt = []
                let res = await this.$axios.post("/port/index/message", { key: this.$key, id:  aid})
                console.log(res);
                let code = res.data.code
                if (code == 200) {
                    let data = res.data.data
                    this.kaoshi = data[0]
                    this.beikao = data[1]
                    this.thenew = data[2]
                    this.$store.commit("getSecondTitle",data[0].name)
                }
                
            },
        },
    }
</script>

<style lang="scss" scoped>
#second {
    width: 100%;
    box-sizing: border-box;
    margin: 0 auto;
    background-color: #f5f5f5;
}
</style>